package com.xuewei.pagedemo.controller;


import com.xuewei.pagedemo.entity.TDept;
import com.xuewei.pagedemo.service.ITDeptService;
import com.xuewei.springcloudcommon.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangxuewei
 * @since 2023-04-10
 */
@RestController
@RequestMapping("/dept")
public class TDeptController {

    @Autowired
    ITDeptService deptService;

    @GetMapping(value = "/get/{id}")
    public Result getById(@PathVariable Integer id){
        TDept byId = deptService.getById(id);
        return Result.ok(byId);
    }

    @GetMapping(value = "/add")
    public void add(){
        deptService.add();
    }


}

